<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class FootPrintLog
{

###################################################################################################
/*this function gets a user activity description as a parameter and
* store it to the databse along with the user id. If the parameter is NULL,
* it assumes user is just signed into the account*/
	function footPrintLogger($userid, $activity, $accessid){
	
		$CI =& get_instance();
		if($activity == 'login'){
			
			//system requesting to insert a login activity. so this will return an access id
			$CI->load->model('system_model');
			$result = $CI->system_model->insert_footprint($userid,NULL,NULL);
			if($result != false){
				
				return $result;
			}
		
			//login activity can not be inserted
			else{
				
				return false;
			}
			
		}
	
		else{
			//system requesting to insert an in-system activity
			$CI->load->model('system_model');
			$result = $CI->system_model->insert_footprint($userid,$accessid,$activity);
			
			if($result == true){
				return true;
			}
	
			//in-system activity can not be inserted
			else{
				return false;
			}
		}
	}
}


?>